<!-- 
    @author Wójcik Karol <wojcikk@student.agh.edu.pl>
    @licence http://www.gnu.org/copyleft/gpl.html GNU/GPL
-->

<div id="colOne">
    <%= render :partial => "menu" %>
</div>
<div id="colTwo">
<% if @positions.blank? %>
    <h1>Aktualnie nie ma dost&#281;pnych stanowisk</h1>
<% else %>
<h1>Stanowiska</h1>

<table>
  <tr>
    <th>Nazwa</th>
  </tr>
  
<% for position in @positions %>
  <tr>
  <% for column in Position.content_columns %>
    <td><%=h position.send(column.name) %></td>
  <% end %>
    <td><%= link_to 'Poka&#380;', :action => 'show', :id => position %></td>
    <td><%= link_to 'Zmie&#324;', :action => 'edit', :id => position %></td>
    <td><%= link_to 'Usu&#324;', { :action => 'destroy', :id => position }, :confirm => 'Jeste&#347; pewny?', :post => true %></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @position_pages.current.previous } if @position_pages.current.previous %>
<%= link_to 'Next page', { :page => @position_pages.current.next } if @position_pages.current.next %> 

<br />
<% end %>
<%= link_to 'Utw&#243;rz nowe', :action => 'new' %>
</div>